package com.itheima.a14waitandnotify;

import java.util.concurrent.ArrayBlockingQueue;

public class ThreadDemo {
    public static void main(String[] args) {
        //创建一个阻塞队列
        //细节：阻塞队列中已经有锁对象了，我们就不需要自己定义了，要不然会出现死锁
        ArrayBlockingQueue<String> queen = new ArrayBlockingQueue<>(1);

        //创建线程对象
        Cook c = new Cook(queen);
        Foodie f = new Foodie(queen);

        //启动线程
        c.start();
        f.start();
    }
}
